namespace TXLooker.WorkItemExtention.WIQL
{
    using System;

    public class NodeNumber : NodeItem
    {
        public NodeNumber(string s) : base(NodeType.Number, s)
        {
        }

        public override void Bind(IExternal e, NodeTableName tableContext, NodeFieldName fieldContext)
        {
            Tools.EnsureSyntax(Tools.IsNumericString(base.Value), SyntaxError.StringIsNotANumber, this);
            base.Bind(e, tableContext, fieldContext);
        }

        public override string ConstStringValue
        {
            get
            {
                return base.Value;
            }
        }

        public override DataType DataType
        {
            get
            {
                return DataType.Numeric;
            }
        }

        public override bool IsConst
        {
            get
            {
                return true;
            }
        }
    }
}

